package com.jk.garden1.controller;

import com.jk.garden1.entity.BuildingEntity;
import com.jk.garden1.entity.FollowPeopleEntity;
import com.jk.garden1.service.BuildingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 楼宇维护
 */
@RestController
@RequestMapping("building")
public class BuildingController {
    @Autowired
    private BuildingService buildingService;
    /**
     * 查询全部
     */
    @RequestMapping("selectListBuilding")
    public List<BuildingEntity> selectListBuilding(BuildingEntity buildingEntity){
        return buildingService.selectListBuilding(buildingEntity);
    }
    /**
     * 添加楼宇
     */
    @RequestMapping("addBuilding")
    public void addBuilding(BuildingEntity buildingEntity){
        buildingService.addBuilding(buildingEntity);
    }
    /**
     * 停用
     */
    @RequestMapping("updateById")
    public void updateById(Integer id){
        buildingService.updateById(id);
    }


    /**
     * es高亮查询
     */
    @RequestMapping("queryEsList")
    public  Object queryEsList(BuildingEntity building){
        return buildingService.queryEsList(building);
    }
    /**
     * 查询随访人信息
     */
    @RequestMapping("findSuiFangList")
    public FollowPeopleEntity findSuiFangList(Integer visitorid){
        return buildingService.findSuiFangList(visitorid);
    }
}
